LanguageExt.Core ► Effects ► Pipes ► Producer
Contents
- Producer <OUT, M, A>
- Value
- Producer (Proxy<Void, Unit, Unit, OUT, M, A> value)
- ToProxy ()
- Bind <S> ( Func<A, Proxy<Void, Unit, Unit, OUT, M, S>> f)
- Bind <B> (Func<A, K<M, B>> f)
- Bind <B> (Func<A, IO<B>> f)
- Map <B> (Func<A, B> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- Bind <B> (Func<A, Producer<OUT, M, B>> f)
- SelectMany <B> (Func<A, Producer<OUT, M, B>> f)
- SelectMany <B, C> (Func<A, Producer<OUT, M, B>> f, Func<A, B, C> project)
- Select <B> (Func<A, B> f)
- For <C1, C> (Func<OUT, Proxy<Void, Unit, C1, C, M, Unit>> body)
- Action <B> (Proxy<Void, Unit, Unit, OUT, M, B> r)
- PairEachRequestWithRespond <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, Void, Unit, M, A>> lhs)
- ReplaceRequest <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, Unit, OUT, M, Unit>> lhs)
- PairEachRespondWithRequest <DInC, DOutC> ( Func<OUT, Proxy<Unit, OUT, DInC, DOutC, M, A>> rhs)
- ReplaceRespond <DInC, DOutC> ( Func<OUT, Proxy<Void, Unit, DInC, DOutC, M, Unit>> rhs)
- Reflect ()
- Observe ()
- | (Producer<OUT, M, A> p1, Consumer<OUT, M, A> p2)
- | (Producer<OUT, M, A> p1, Consumer<OUT, A> p2)
- Deconstruct (out Proxy<Void, Unit, Unit, OUT, M, A> value)
- SelectMany <B> (Func<A, Producer<OUT, B>> bind)
- SelectMany <B, C> (Func<A, Producer<OUT, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project)
- & ( Producer<OUT, M, A> lhs, Producer<OUT, M, A> rhs)
- ToString ()
- Producer
- Pure <OUT, M, R> (R value)
- yield <OUT, M> (OUT value)
- yieldAll <M, X> (IEnumerable<X> xs)
- yieldAll <M, X> (IAsyncEnumerable<X> xs)
- yieldAll <M, X> (IObservable<X> xs)
- repeatM <M, A> (K<M, A> ma)
- lift <OUT, M, R> (K<M, R> ma)
- liftIO <OUT, M, R> (IO<R> ma)
- FoldUntil <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<A, bool> UntilValue)
- FoldWhile <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<A, bool> WhileValue)
- FoldUntil <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<S, bool> UntilState)
- FoldWhile <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<S, bool> WhileState)
- merge_OLD <OUT, M> (Seq<Producer<OUT, M, Unit>> ms)
- merge <OUT, M> (Seq<Producer<OUT, M, Unit>> ms)
- merge <OUT, M> (params Queue<OUT, M, Unit>[] ms)
- merge <OUT, M> (params Producer<OUT, M, Unit>[] ms)
- merge <OUT, M> (params Proxy<Void, Unit, Unit, OUT, M, Unit>[] ms)
- merge <OUT, M> (Seq<Queue<OUT, M, Unit>> ms)
- merge <OUT, M> (Seq<Proxy<Void, Unit, Unit, OUT, M, Unit>> ms)
record Producer <OUT, M, A> Source #
Producers can only yield
Upstream | Downstream
+---------+
| |
Void <== <== Unit
| |
Unit ==> ==> OUT
| | |
+----|----+
|
A
Constructors
Methods
method Proxy<Void, Unit, Unit, OUT, M, A> ToProxy () Source #
Calling this will effectively cast the sub-type to the base.
This type wraps up a Proxy
for convenience, and so it's a Proxy
proxy. So calling this method
isn't exactly the same as a cast operation, as it unwraps the Proxy
from within. It has the same effect
however, and removes a level of indirection
Parameters
returns | A general |
method Proxy<Void, Unit, Unit, OUT, M, S> Bind <S> ( Func<A, Proxy<Void, Unit, Unit, OUT, M, S>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, B> Bind <B> (Func<A, K<M, B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, B> Bind <B> (Func<A, IO<B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Proxy<Void, Unit, Unit, OUT, M, B> Map <B> (Func<A, B> f) Source #
Lifts a pure function into the Proxy
domain, causing it to map the bound value within
Parameters
type | B | The mapped bound value type |
param | f | The map function |
returns | A new |
method Proxy<Void, Unit, Unit, OUT, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Map the lifted monad
Parameters
type | B | The mapped bound value type |
param | f | The map function |
returns | A new |
method Producer<OUT, M, B> Bind <B> (Func<A, Producer<OUT, M, B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, B> SelectMany <B> (Func<A, Producer<OUT, M, B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, C> SelectMany <B, C> (Func<A, Producer<OUT, M, B>> f, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, B> Select <B> (Func<A, B> f) Source #
Lifts a pure function into the Proxy
domain, causing it to map the bound value within
Parameters
type | B | The mapped bound value type |
param | f | The map function |
returns | A new |
method Proxy<Void, Unit, C1, C, M, A> For <C1, C> (Func<OUT, Proxy<Void, Unit, C1, C, M, Unit>> body) Source #
For(body)
loops over the Proxy p
replacing each yield
with body
Parameters
param | body | Any |
returns | A new |
method Proxy<Void, Unit, Unit, OUT, M, B> Action <B> (Proxy<Void, Unit, Unit, OUT, M, B> r) Source #
Applicative action
Invokes this Proxy
, then the Proxy r
Parameters
param | r |
|
method Proxy<UOutA, AUInA, Unit, OUT, M, A> PairEachRequestWithRespond <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, Void, Unit, M, A>> lhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
(f +>> p) pairs each 'request' in this
with a 'respond' in lhs
.
method Proxy<UOutA, AUInA, Unit, OUT, M, A> ReplaceRequest <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, Unit, OUT, M, Unit>> lhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
method Proxy<Void, Unit, DInC, DOutC, M, A> PairEachRespondWithRequest <DInC, DOutC> ( Func<OUT, Proxy<Unit, OUT, DInC, DOutC, M, A>> rhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
method Proxy<Void, Unit, DInC, DOutC, M, A> ReplaceRespond <DInC, DOutC> ( Func<OUT, Proxy<Void, Unit, DInC, DOutC, M, Unit>> rhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
method Proxy<OUT, Unit, Unit, Void, M, A> Reflect () Source #
Reverse the arrows of the Proxy
to find its dual.
Parameters
returns | The dual of |
method Proxy<Void, Unit, Unit, OUT, M, A> Observe () Source #
Observe(lift (Pure(r))) = Observe(Pure(r))
Observe(lift (m.Bind(f))) = Observe(lift(m.Bind(x => lift(f(x)))))
This correctness comes at a small cost to performance, so use this function sparingly. This function is a convenience for low-level pipes implementers. You do not need to use observe if you stick to the safe API.
method void Deconstruct (out Proxy<Void, Unit, Unit, OUT, M, A> value) Source #
method Producer<OUT, M, B> SelectMany <B> (Func<A, Producer<OUT, B>> bind) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, C> SelectMany <B, C> (Func<A, Producer<OUT, B>> bind, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Producer<OUT, M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
Parameters
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
Operators
operator | (Producer<OUT, M, A> p1, Consumer<OUT, M, A> p2) Source #
Compose a Producer
and a Consumer
together into an Effect
.
Parameters
param | p1 |
|
param | p2 |
|
returns |
|
Producers can only yield
Upstream | Downstream
+---------+
| |
Void <== <== Unit
| |
Unit ==> ==> OUT
| | |
+----|----+
|
A
Methods
method Producer<OUT, M, R> Pure <OUT, M, R> (R value) Source #
Monad return / pure
method Producer<OUT, M, Unit> yield <OUT, M> (OUT value) Source #
Send a value downstream (whilst in a producer)
This is the simpler version (fewer generic arguments required) of yield
that works
for producers.
method Producer<A, M, Unit> repeatM <M, A> (K<M, A> ma) Source #
Repeat a monadic action indefinitely, yielding each result
method Producer<OUT, M, R> lift <OUT, M, R> (K<M, R> ma) Source #
Lift the IO monad into the Producer monad transformer (a specialism of the Proxy monad transformer)
method Producer<OUT, M, R> liftIO <OUT, M, R> (IO<R> ma) Source #
Lift the IO monad into the Producer monad transformer (a specialism of the Proxy monad transformer)
method Producer<S, M, Unit> FoldUntil <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<A, bool> UntilValue) Source #
Folds values coming down-stream, when the predicate returns true the folded value is yielded
Parameters
param | Initial | Initial state |
param | Fold | Fold operation |
param | UntilValue | Predicate |
returns | A pipe that folds |
method Producer<S, M, Unit> FoldWhile <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<A, bool> WhileValue) Source #
Folds values coming down-stream, when the predicate returns true the folded value is yielded
Parameters
param | Initial | Initial state |
param | Fold | Fold operation |
param | UntilValue | Predicate |
returns | A pipe that folds |
method Producer<S, M, Unit> FoldUntil <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<S, bool> UntilState) Source #
Folds values coming down-stream, when the predicate returns true the folded value is yielded
Parameters
param | Initial | Initial state |
param | Fold | Fold operation |
param | UntilValue | Predicate |
returns | A pipe that folds |
method Producer<S, M, Unit> FoldWhile <S, M, A> ( this Producer<S, M, A> ma, S Initial, Func<S, A, S> Fold, Func<S, bool> WhileState) Source #
Folds values coming down-stream, when the predicate returns true the folded value is yielded
Parameters
param | Initial | Initial state |
param | Fold | Fold operation |
param | UntilValue | Predicate |
returns | A pipe that folds |
method Producer<OUT, M, Unit> merge_OLD <OUT, M> (Seq<Producer<OUT, M, Unit>> ms) Source #
Merge a sequence of producers into a single producer
The merged producer completes when all component producers have completed
Parameters
param | ms | Sequence of producers to merge |
returns | Merged producers |
method Producer<OUT, M, Unit> merge <OUT, M> (Seq<Producer<OUT, M, Unit>> ms) Source #
method Producer<OUT, M, Unit> merge <OUT, M> (params Queue<OUT, M, Unit>[] ms) Source #
Merge an array of queues into a single producer
The merged producer completes when all component queues have completed
Parameters
param | ms | Sequence of queues to merge |
returns | Queues merged into a single producer |
method Producer<OUT, M, Unit> merge <OUT, M> (params Producer<OUT, M, Unit>[] ms) Source #
Merge an array of producers into a single producer
The merged producer completes when all component producers have completed
Parameters
param | ms | Sequence of producers to merge |
returns | Merged producers |
method Producer<OUT, M, Unit> merge <OUT, M> (params Proxy<Void, Unit, Unit, OUT, M, Unit>[] ms) Source #
Merge an array of producers into a single producer
The merged producer completes when all component producers have completed
Parameters
param | ms | Sequence of producers to merge |
returns | Merged producers |
method Producer<OUT, M, Unit> merge <OUT, M> (Seq<Queue<OUT, M, Unit>> ms) Source #
Merge a sequence of queues into a single producer
The merged producer completes when all component queues have completed
Parameters
param | ms | Sequence of queues to merge |
returns | Queues merged into a single producer |
method Producer<OUT, M, Unit> merge <OUT, M> (Seq<Proxy<Void, Unit, Unit, OUT, M, Unit>> ms) Source #
Merge a sequence of producers into a single producer
The merged producer completes when all component producers have completed
Parameters
param | ms | Sequence of producers to merge |
returns | Merged producers |